{% extends "base.html" %}
{% block title %}
    {{ cate.name }}分类下所有文章
{% endblock %}
{% block content %}
    <main>
        {{ moment.locale(auto_detect=True) }}
        <div class="container mt-2">
            <div class="row">
                <div class="col-lg-8">
                    <div class="description px-3 pt-3 pb-1 blog-content-brief-div">
                        <p class="float-right mb-0">共<span class="mx-2 text-info">{{ blogs|length }}</span>篇</p>
                        <h5 class="f-17"><strong>文章分类：{{ cate.name }}</strong></h5>
                        <p style="padding-top: 8px" class="f-16">{{ cate.description }}</p>
                    </div>
                    <div class="summary-list">
                        {% for blog in blogs %}
                            {% if blog.delete_flag == 1 %}
                                <div style="border-radius: 5px;" class="media mb-1 mb-sm-2 p-2 p-lg-3 blog-brief-div blog-content-brief-div">
                                    <div class="align-self-center mr-2 mr-lg-3 w-25 modal-open">
                                        <a href="/blog/article/{{ blog.id }}/" target="_blank">
                                            <img class="w-100 article-img" src="{{ blog.pre_img }}" alt="{{ blog.title }}">
                                        </a>
                                    </div>
                                    <div class="media-body">
                                        <div class="text-muted mb-2 f-12">
                                            <span class="badge badge-inverse"><i class="fa fa-user"></i> 清水</span>
                                            <span class="badge badge-inverse"><i class="fa fa-calendar-times-o ml-2 mr-1"></i>{{ moment(blog.create_time, local=True).fromNow(refresh=True) }}</span>
                                        </div>
                                        <h5 class="title-brief">
                                            <a class="text-decoration-none" href="/blog/article/{{ blog.id }}/" target="_blank">{{ blog.title }}</a>
                                        </h5>
                                        <p class="d-none d-sm-block mb-2 f-15">{{ blog.introduce|striptags|truncate(200) }}</p>
                                        <p class="d-block d-sm-none mb-2 f-15">{{ blog.introduce|striptags|truncate(100) }}</p>
                                        <div class="text-muted mb-0 f-12">
                                            <a class="text-info" style="text-decoration: none;" href="/blog/cate/{{ blog.type_id }}/" title="查看当前分类下更多文章">
                                                <span class="badge badge-inverse"><i class="fa fa-book mr-1"></i>{{ cate.name }}({{ blogs|length }})</span></a>
                                            <span class="badge badge-inverse"><i class="fa fa-eye ml-2 mr-1"></i>{{ blog.read_times }}</span>
                                        </div>
                                    </div>
                                </div>
                            {% endif %}
                        {% endfor %}
                    </div>
                </div>
                <div class="col-lg-4">
                    {% include "slider.html" %}
                </div>
            </div>
        </div>
    </main>
{% endblock %}
